1、解压ST的源码
	tar -xvf en.SOURCES-stm32mp1-openstlinux-5-4-dunfell-mp1-20-06-24.tar.xz
2、进入stm32mp1-openstlinux-5.4-dunfell-mp1-20-06-24/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.4.31-r0/目录
	cd stm32mp1-openstlinux-5.4-dunfell-mp1-20-06-24/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.4.31-r0/
3、解压linux源码
	tar -vxf linux-5.4.31.tar.xz
4、进入Linux源码目录
	cd linux-5.4.31/
5、为Linux打上ST的补丁
	for p in `ls -1 ../*.patch`; do patch -p1 < $p; done 
6、利用multi_v7_defconfig、fragment-02-multiv7_addons.config、fragment-01-multiv7_cleanup.config对内核进行配置
	make ARCH=arm multi_v7_defconfig "fragment*.config"
7、为配置文件打补丁
	for f in `ls -1 ../fragment*.config`; do scripts/kconfig/merge_config.sh -m -r .config $f; done
8、使能所有配置项
	yes '' | make ARCH=arm oldconfig
9、创建默认配置文件
	cp .config ./arch/arm/configs/stm32mp1_atk_defconfig
10、移植phy驱动
	1）将motorcomm.c拷贝到drivers/net/phy目录下，将motorcomm_phy.h拷贝到include/linux目录下
	2）修改drivers/net/phy/Makefile文件，在末尾增加：
		obj-$(CONFIG_MOTORCOMM_PHY) += motorcomm.o
	3）修改 drivers/net/phy/Kconfig 文件，在endif # PHYLIB前面增加：
		config MOTORCOMM_PHY
			tristate "Motorcomm PHYs"
			---help---
			  Supports the YT8010, YT8510, YT8511, YT8512 PHYs.
	4）接下来在menuconfig中使能YT8511驱动
		-> Device Drivers
			-> Network device support (NETDEVICES [=y])
				-> PHY Device support and infrastructure (PHYLIB [=y])
					-> <*> Motorcomm PHYs #使能YT8511驱动
11、进行编译测试
	make distclean
	make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- stm32mp1_atk_defconfig
	make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- menuconfig
	make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- all LOADADDR=0XC2000040 -j16
	编译完成后设备数在arch/arm/boot/dts/目录，内核在arch/arm/boot/目录
12、创建设备树
	开发板参考STM32MP157D EVK设计，其设备树是stm32mp157d-ev1，又因stm32mp157d-ev1引用stm32mp157d-ed1，所以这里以stm32mp157d-ed1为蓝本
	stm32mp157d-ed1.dts描述ed1开发板的特有属性
	cp arch/arm/boot/dts/stm32mp157d-ed1.dts arch/arm/boot/dts/stm32mp157d-atk.dts
	stm32mp15xx-edx.dtsi描述ed系列开发板公共属性
	cp arch/arm/boot/dts/stm32mp15xx-edx.dtsi arch/arm/boot/dts/stm32mp157d-atk.dtsi
13、修改设备树文件stm32mp157d-atk.dts
	gedit arch/arm/boot/dts/stm32mp157d-atk.dts
	将14行的sstm32mp15xx-edx.dtsi修改为stm32mp157d-atk.dtsi
	将17行的STMicroelectronics STM32MP157D eval daughter修改为Alientek STM32MP157DAA development board
	将18行stm32mp157d-ed1修改为stm32mp157d-atk
14、修改设备树文件stm32mp157d-atk.dtsi
	gedit arch/arm/boot/dts/stm32mp157d-atk.dtsi
	删除跟节点中的led节点、sd_switch节点、vin节点
	删除&dac节点、&dac节点、&i2c4节点、&m4_rproc节点、&pwr_regulators节点、&usbotg_hs节点、&usbphyc_port0节点、&usbphyc_port1节点
	在跟节点中添加描述电源的节点：
		vddcore: buck1 {
			compatible = "regulator-fixed";
			regulator-name = "vddcore";
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1350000>;
			regulator-always-on;
			regulator-boot-on;
		};
		
		v3v3: regulator-3p3v {
			compatible = "regulator-fixed";
			regulator-name = "v3v3";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			regulator-always-on;
			regulator-boot-on;
		};
	添加网卡节点：
		&ethernet0 {
			status = "okay";
			pinctrl-0 = <&ethernet0_rgmii_pins_a>;
			pinctrl-1 = <&ethernet0_rgmii_pins_sleep_a>;
			pinctrl-names = "default", "sleep";
			phy-mode = "rgmii-id";
			max-speed = <1000>;
			phy-handle = <&phy0>;
			
			mdio0 {
				#address-cells = <1>;
				#size-cells = <0>;
				compatible = "snps,dwmac-mdio";
				phy0: ethernet-phy@0 {
					reg = <0>;
				};
			};
		};
	修改&sdmmc1节点
		&sdmmc1 {
			pinctrl-names = "default", "opendrain", "sleep";
			pinctrl-0 = <&sdmmc1_b4_pins_a>;
			pinctrl-1 = <&sdmmc1_b4_od_pins_a>;
			pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
			broken-cd;
			st,neg-edge;
			bus-width = <4>;
			vmmc-supply = <&v3v3>;
			status = "okay";
		};
	修改&sdmmc2节点
		&sdmmc2 {
			pinctrl-names = "default", "opendrain", "sleep";
			pinctrl-0 = <&sdmmc2_b4_pins_a>;
			pinctrl-1 = <&sdmmc2_b4_od_pins_a>;
			pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
			non-removable;
			st,neg-edge;
			bus-width = <8>;
			vmmc-supply = <&v3v3>;
			keep-power-in-suspend;
			status = "okay";
		};
15、修改arch/arm/boot/dts/Makefile，增加stm32mp157d-atk设备树的编译选项
	gedit arch/arm/boot/dts/Makefile
	在dtb-$(CONFIG_ARCH_STM32)配置项中加入stm32mp157d-atk.dtb
16、关闭内核模块验证
	make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- menuconfig
		-> Enable loadable module support (MODULES [=y])
			->Module signature verification
17、进行编译测试
	make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- distclean
	make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- stm32mp1_atk_defconfig
	关闭内核模块验证、使能YT8511驱动
	make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- all LOADADDR=0XC2000040 -j16
	make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- uImage dtbs LOADADDR=0XC2000040 -j16
	make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- INSTALL_MOD_PATH=/home/lf/workspace/rootfs INSTALL_MOD_STRIP=1 modules_install
	编译完成后设备数在arch/arm/boot/dts/目录，内核在arch/arm/boot/目录
18、进行启动测试
	setenv bootcmd 'tftp c2000000 uImage;tftp c4000000 stm32mp157d-atk.dtb;bootm c2000000 - c4000000'
	setenv bootargs 'console=ttySTM0,115200 root=/dev/nfs nfsroot=192.168.2.55:/home/lf/workspace/rootfs,proto=tcp rw ip=192.168.2.250:192.168.2.55:192.168.2.1:255.255.255.0::eth0:off'